* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    overflow-x: hidden; /* 防止导航栏出现水平滚动条 */
}

/* LOGO按钮和导航栏样式 */
.navbar-container {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
}

.logo-btn {
    position: fixed;
    top: 5px;
    left: 5px;
    width: 50px;
    height: 50px;
    background-color: #2c3e50;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1001;
    transition: transform 0.3s ease;
}

.logo-btn:hover {
    transform: scale(1.1);
}

.hamburger-icon span {
    display: block;
    width: 24px;
    height: 3px;
    background-color: white;
    margin: 2px 0;
    border-radius: 2px;
    transition: 0.3s;
}

/* 导航栏样式 */
.side-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100%;
    background-color: #34495e;
    padding-top: 80px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.side-nav.active {
    transform: translateX(0);
}

.nav-header {
    padding: 20px;
    color: white;
    border-bottom: 1px solid #2c3e50;
}

.nav-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-list li {
    padding: 15px 20px;
    color: #ecf0f1;
    cursor: pointer;
    border-bottom: 1px solid #2c3e50;
    transition: background-color 0.3s;
}

.nav-list li:hover {
    background-color: #2c3e50;
}

.nav-list .loading {
    text-align: center;
    color: #bdc3c7;
    font-style: italic;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

h1 {
    font-size: 2rem;
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    padding: 10px;
    max-width: 1200px;
    margin: 0 auto;
    justify-items: center;
}

.thumbnail {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    object-position: center top;
    display: block;
}

.image-info {
    padding: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.image-info p {
    font-size: 0.8rem;
    color: #777;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

.loading, .no-images {
    text-align: center;
    padding: 40px;
    font-size: 1.2rem;
    color: #777;
    grid-column: 1 / -1;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
}

.modal-content {
    display: block;
    width: 80%;
    max-width: 700px;
    max-height: 80%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* transition: transform 0.3s ease; */
    animation-name: zoom;
    animation-duration: 0.3s;
}

@keyframes zoom {
    from {transform: scale(0.8)}
    to {transform: scale(1)}
}

#modal-image {
    display: block;
    max-width: 100%;
    max-height: 100vh; /* 允许图像占满整个视口高度 */
    cursor: grab;
    /* 确保图像在容器中正确居中 */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    padding: 0;
    object-fit: contain;
    z-index: 1000;
}

#modal-image:active {
    cursor: grabbing;
}

.close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    z-index: 1001;
}

.close:hover,
.close:focus {
    color: #bbb;
    text-decoration: none;
    cursor: pointer;
}

/* 导航按钮样式 */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0,0,0,0.5);
    color: white;
    border: none;
    font-size: 24px;
    padding: 0;
    cursor: pointer;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: background-color 0.3s;
    line-height: 1;
    text-align: center;
    align-content: center;
}

.nav-btn:hover {
    background-color: rgba(0,0,0,0.8);
}

.prev-btn {
    left: 20px;
}

.next-btn {
    right: 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
    }

    .nav-btn {
        width: 40px;
        height: 40px;
        font-size: 20px;
        padding: 0;
    }

    .prev-btn {
        left: 10px;
    }

    .next-btn {
        right: 10px;
    }
}